package cn.kicsy.www.anonymous_bbs.service;

import org.springframework.stereotype.Service;
import java.util.Random;

@Service
public class RandomNicknameService {
    
    private static final String[] ADJECTIVES = {
        "快乐的", "神秘的", "勇敢的", "聪明的", "善良的", 
        "可爱的", "优雅的", "强大的", "温柔的", "幽默的",
        "活泼的", "安静的", "热情的", "冷静的", "机智的",
        "勤奋的", "乐观的", "坚强的", "自信的", "谦虚的"
    };
    
    private static final String[] NOUNS = {
        "猫咪", "狗狗", "兔子", "老虎", "狮子",
        "熊猫", "企鹅", "海豚", "蝴蝶", "蜜蜂",
        "星星", "月亮", "太阳", "云朵", "雨滴",
        "花朵", "树木", "小草", "山峰", "河流",
        "书本", "画笔", "音符", "咖啡", "蛋糕"
    };
    
    private final Random random = new Random();
    
    /**
     * 生成随机昵称
     * @return 随机生成的昵称
     */
    public String generateRandomNickname() {
        String adjective = ADJECTIVES[random.nextInt(ADJECTIVES.length)];
        String noun = NOUNS[random.nextInt(NOUNS.length)];
        int number = 1000 + random.nextInt(9000); // 生成1000-9999的随机数
        
        return adjective + noun + number;
    }
}